import Vue from 'vue'
import Vuex from 'vuex'
import {getLatestStationInfo} from "@/api/java/stationInfo";
import currentTimeStamp from "@/store/currentTimeStamp";
Vue.use(Vuex)


export default new Vuex.Store({
    state: {
        stationInfo: []
    }, getters: {}, mutations: {
        GetStationInfo(state, stationInfo) {
            state.stationInfo = stationInfo
        }
    }, actions: {
        // 调用获取站点信息API并且存储到vuex
        GetStation({commit, state}) {
            getLatestStationInfo().then(res => {
                commit('GetStationInfo', res.data)
            })
        }
    }, modules: {currentTimeStamp}
})
